//
//  ZFCountdownView.h
//  ZFCountdownView
//
//  Created by fyzq on 2021/9/8.
//

#import <UIKit/UIKit.h>
@class ZFCountdownView,ZFTipConfig;
typedef ZFCountdownView *_Nonnull(^MarkerBlock)(NSString * _Nonnull title);
typedef NS_ENUM(NSInteger,ZFCountdownViewType){
    ZFCountdownViewTypeCountDown = 0,///倒计时
    ZFCountdownViewTypeCountUp, ///增加
};
typedef NS_ENUM(NSInteger,ZFCountdownViewTimeType){
    ZFCountdownViewTimeTypeYear = 0,
    ZFCountdownViewTimeTypeMonth,
    ZFCountdownViewTimeTypeDay,
    ZFCountdownViewTimeTypeHour,
    ZFCountdownViewTimeTypeMintue,
    ZFCountdownViewTimeTypeSecond,
};

NS_ASSUME_NONNULL_BEGIN
@interface ZFCountdownView : UIView

-(MarkerBlock)addYear;
-(MarkerBlock)addMonth;
-(MarkerBlock)addDay;
-(MarkerBlock)addHour;
-(MarkerBlock)addMinute;
-(MarkerBlock)addSecond;
-(ZFCountdownView *)layoutSubview:(ZFTipConfig *)config;
////开始时间戳
-(ZFCountdownView *)startCountDownType:(ZFCountdownViewType)type time:(NSTimeInterval)time;
@property(nonatomic,copy,readonly)NSMutableArray *items;


@end


@interface ZFCountdownItemView : UIView
@property(nonatomic,copy)NSString *title;
@property(nonatomic,copy)NSString *tip;
@property(nonatomic,strong)ZFTipConfig *config;
@end

@interface ZFTipConfig : NSObject
///主界面字体颜色 默认白色
@property(nonatomic,strong)UIColor *timeColor;
///主界面背景颜色 默认橙色
@property(nonatomic,strong)UIColor *timeBackgroundColor;
///主界面字体大小 默认14
@property(nonatomic,strong)UIFont *timeFont;
///主界面间距 默认（5，5，5，5）
@property(nonatomic,assign)UIEdgeInsets timeInsets;
///主界面圆角 默认3
@property(nonatomic,assign)CGFloat timeRadius;

///分段颜色 默认灰色
@property(nonatomic,strong)UIColor *tipColor;
///分段背景颜色 默认clear
@property(nonatomic,strong)UIColor *tipBackgroundColor;
///分段字体大小 默认14
@property(nonatomic,strong)UIFont *tipFont;
///分段左右间距 默认3
@property(nonatomic,assign)CGFloat tipspace;

@end

typedef void(^ZFTimerBlock)(void);
@interface ZFTimer : NSObject

-(void)startTimer:(ZFTimerBlock)handler;
-(void)close;
@end
NS_ASSUME_NONNULL_END
